0 CLS:PRINT"THE":GOSUB9060:CLEAR1000:DIMX,Y,O$(52),O(85),R$(32),R(32),D$(32),V$(6):GOTO100
1 X=1:Y=32
2 IFMID$(M$,Y,1)<>""ANDMID$(M$,Y,1)<>" "THENY=Y-1:GOTO2
3 PRINTMID$(M$,X,Y-X):X=Y+1:Y=X+31:IFX<=LEN(M$)THEN2
4 RETURN
5 GOSUB8090
6 GOTO3630
7 GOTO7460
8 M$="OK"
9 GOSUB1:GOTO540
100 ME=1:NO=52:NR=32:FORI=1TO32:READR$(I):NEXT:FORI=1TO32:READD$(I):NEXT:FORI=1TONO:READO(I):NEXT:FORI=1TONO:READO$(I):NEXT
130 V$(1)="NORTH":V$(2)="SOUTH":V$(3)="EAST":V$(4)="WEST":V$(5)="UP":V$(6)="DOWN":R=1:GOTO5
150 DATA"A DARK, DAMP AND GLOOMY PIT. RAYS OF LIGHT SHINING DOWN FROM ABOVE ARE THE ONLY SOURCE OF LIGHT."
160 DATA"A SMALL NARROW OPENING.","A TUNNEL.","A LARGE UNDERGROUNG CAVERN.","AN UNDERGROUND HOLLOW.","AN OPEN FIELD."
190 DATA"A YARD.","IN AN OLD ABANDONED SHACK.","A SMALL, DINGY BEDROOM.","A KITCHEN.","A SMALL SENTRY POST."
270 DATA"NEXT TO A MOAT.","INSIDE A MERCHANT'S TENT.","A RIVER BANK.","AN EERIE GRAVEYARD.","NEAR A BOTTOMLESS CHASM."
300 DATA"A SMALL SANDY CLEARING.","A CLIFF RIDDEN AREA.","A LARGE CLOSET.","A LONG FEATURELESS HALL."
310 DATA"INSIDE AN ANCIENT ARCHIVE.","A COURTYARD OF THE CASTLE.","THE GUARDS ROOM","A SMALL SECRET ROOM."
390 DATA"A WEAPON ROOM.","AN OLD SMELLY DUNGEON.","A BLOOD STAINED TORTURE CHAMBER.","A SECRET CAVE.","ON TOP OF A LADDER."
420 DATA"A DRAGON'S LAIR.","A ROOM WITH WALLS OF SOLID GOLD.","A BIG HOLE, WITH WALLS OF SOLID GOLD."
480 DATA"1","2","34","34","3","1236","2","234","3","4","2","4","14","3","2","1","4","3","4","1","4","1234","4","1","23"
490 DATA"45","3","2","6","13","4","5"
540 IFR=2THENEG=EG+1:IFEG=10ANDO(54)<>1THEN7620
550 IFR=30ANDDD<>1THENFB=FB+1
560 IFFB<>3THEN610
561 SH=SH+1:IFO(44)<>-1THEN9040
580 IFO(44)=-1THENM$="THE DRAGON SENDS A BREATH OF FIRE AT ME, BUT IT REFLECTS OFF MY SHIELD.":GOSUB1:FB=0
590 IFSH=2THENM$="I DON'T KNOW IF I CAN HOLD THE SHIELD FOR MUCH LONGER-- IT'S VERY HOT!":GOTO9
600 IFSH=3THENM$="TOO HOT! I DROP THE SHIELD!":GOSUB1:O(44)=R:GS=1:GOTO5
610 INPUT"COMMAND";A$:X=LEN(A$):IFA$<"A"ORA$>"Z"ORX<1ORX>20THEN7310
650 A$=A$+" ":FORI=1TOX+1:IFMID$(A$,I,1)<>" "THENNEXT
680 F$=LEFT$(A$,I-1)
690 FORI=LEN(A$)-1TO1STEP-1:IFMID$(A$,I,1)<>" "THENNEXT
710 S$=MID$(A$,I+1,LEN(A$)-I-1)
720 X=ASC(A$)-64:ONXGOTO750,750,790,1020,1270,2000,2070,3100,3100,3300,3510,3610,3740,3840,3970,4150
740 ONX-16GOTO4400,4470,4600,5340,5520,5890,5890,7,7310,7310:GOTO7310
750 IFF$<>"BUY"THEN7310
770 GOTO3020
790 IFF$<>"CLIMB"THEN880
810 FORI=1TONO:IFS$=O$(I)THEN830
811 NEXT:GOTO7310
830 IFO(I)=-1ORO(I)<>RTHEN7360
850 IFS$=O$(1)ANDO(1)=1THENO(56)=1:GOTO7250
860 IFS$=O$(1)THENO(56)=0:GOTO7250
870 IFS$=O$(49)THENM$="THE WALLS ARE FAR TOO SLIPPERY.":GOTO9
875 GOTO7580
880 IFF$<>"CHOP"THEN1000
890 FORI=1TONO:IFS$=O$(I)THEN910
900 NEXT:GOTO7310
910 IFO(8)=-1ANDBA=0THEN940
920 IFO(8)<>-1THEN7360
930 IFBA=1THENM$="TRY EXAMINING AXE!":GOTO9
940 IFR=6ANDS$=O$(3)ANDAD<>1THENM$="THE VIBRATIONS LOOSEN THE APPLE, AND IT FALLS TO THE GROUND.":AD=1:BA=1:O(4)=6:AA=1:GOTO9
950 IFR=20ANDS$=O$(30)THENM$="I MAKE A HOLE BIG ENOUGH TO GET THROUGH.":CC=1:BA=1:GOTO9
960 IFR=7ANDS$=O$(35)THENGOSUB995:O(35)=0:O(48)=7:BA=1:GOTO5
980 IFR=1ORR=2ANDS$=O$(1)THENGOSUB995:LD=1:BA=1:O(1)=0:O(50)=R:GOTO5
990 GOTO7580
995 M$="YOU CHOP IT TO SPLINTERS.":GOSUB1:RETURN
1000 IFF$<>"CUT"THEN7310
1010 GOTO5160
1020 IFF$<>"D"THEN1070
1040 IFR=6THEN6180
1050 IFR=29ANDSR=1THEN6180
1060 IFR=29ANDSR=2THEN6210
1065 GOTO7460
1070 IFF$<>"DROP"THEN1140
1080 FORI=1TONO:IFS$=O$(I)THEN1100
1090 NEXT:GOTO7310
1100 IFO(I)<>-1THEN7360
1110 IFS$=O$(31)THENWG=0
1120 IFS$=O$(26)THEN4280
1130 O(I)=R:EI=EI-1:GOTO6
1140 IFO(9)<>-1THEN7360
1160 IFF$<>"DIG"THEN7310
1170 IFR<>15THEN1220
1180 IFDF=1THEN7500
1190 IFSA<>1THENM$="GHOST WON'T LET ME!":GOTO9
1200 O(13)=15:O(15)=15:DF=1:GOTO7520
1220 IFR<>17THEN7500
1230 IFDS=1THEN7500
1240 O(10)=17:DS=1:GOTO7520
1270 IFF$<>"E"THEN1460
1280 ONRGOTO7,7,6210,6240,6270,6510,7,6450,6390,7,7,7,7,6540,7,7,7,6660,6760,7,7,6790,7,7,6850,7,6940,7,7,1420:GOTO7
1420 IFDD<>1THEN9050
1430 GOTO7140
1460 IFLEFT$(F$,4)<>"EXAM"THEN1500
1470 FORI=1TONO:IFS$=O$(I)THEN1500
1480 NEXT:GOTO7310
1500 IFO(I)<>RANDO(I)<>-1THEN7360
1510 IFS$=O$(1)THENM$="IT'S FAIRLY SHORT.":GOTO9
1520 IFS$<>O$(39)THEN1550
1530 IFR=16ORR=17THENM$="IT'S 2-METRES WIDE.":GOTO9
1531 GOTO7360
1550 IFS$=O$(2)THENM$="HE GIVES YOU A BIG GRIN, WHILST LICKING HIS CHOPS.":GOTO9
1560 IFS$=O$(18)THENM$="IT'S GOT SOMETHING WRITTEN ON IT.":GOTO9
1570 IFS$=O$(19)THENM$="IT LOOKS QUITE VALUABLE.":GOTO9
1580 IFS$=O$(44)ANDSH=0THENM$="IT'S GOT A SENSE OF STRENGTH ABOUT IT!":GOTO9
1590 IFS$=O$(44)ANDSH>1THENM$="THE SHIELD IS RED HOT!":GOTO9
1600 IFS$=O$(3)ANDAA=0THEN1610
1601 GOTO1620
1610 M$="THE TREE IS PETRIFIED, YET THERE IS A RED APPLE ON ONE OF ITS BRANCHES.":GOSUB1:O(4)=R:AA=1:GOTO5
1620 IFS$=O$(3)ANDAA=1ANDAD=0THEN1610
1630 IFS$=O$(3)ANDAD=1THENM$="IT'S PETRIFIED!":GOTO9
1640 IFS$="SYMBOL"THENM$="IT RESEMBLES A GHOST.":GOTO9
1650 IFS$=O$(37)THENM$="IT'S RUSTY.":GOTO9
1660 IFS$=O$(4)THENM$="IT'S A BIG, RED, HEATHLY, LOOKING APPLE.":GOTO9
1670 IFS$=O$(21)THENM$="IT'S STUCK TO THE WALL":GOTO9
1680 IFS$=O$(22)THENM$="IT'S A SMELLY DECAYED CORPSE.":GOTO9
1690 IFS$=O$(51)THENM$="IT'S THE TREASURE OF ELGON!":GOTO9
1700 IFS$=O$(36)THENM$="IT'S A SHARPENING STONE.":GOTO9
1710 IFS$=O$(24)THENM$="THERE'S SOMETHING WRITTEN ON IT.":GOTO9
1720 IFS$=O$(6)THENM$="IT LOOKS DESERTED.":GOTO9
1730 IFS$=O$(26)THENM$="IT SEEMS STURDY.":GOTO9
1740 IFS$=O$(7)ANDMS=0THENM$="HE LOOKS POOR.":GOTO9
1750 IFS$=O$(7)ANDMS=1THENM$="HE'S DEAD! AND I DON'T THINK HIS CONDITION WILL GET ANY BETTER!":GOTO9
1760 IFS$<>O$(20)THEN1790
1770 IFAI<>1THENM$="THERE'S A SMALL ROUND HOLE IN THE MIDDLE.":GOTO9
1780 M$="THERE'S AN ANKH INSERTED IN THE MIDDLE OF IT.":GOTO9
1790 IFS$=O$(8)THEN1980
1800 IFS$=O$(29)THENM$="IT HAS A VERY STRONG CURRENT.":GOTO9
1810 IFS$<>O$(30)THEN1840
1820 IFCC<>1THENM$="IT'S AN OLD LOCKED WOODEN CLOSET.":GOTO9
1830 M$="IT'S GOT A HOLE CHOPPED IN IT.":GOTO9
1840 IFS$=O$(31)THENM$="THEY'RE READING GLASSES.":GOTO9
1850 IFS$=O$(10)THENM$="IT'S GOT A STRANGE SYMBOL THAT PROTRUDES FROM IT.":GOTO9
1860 IFS$=O$(32)THENM$="IT'S STEEL, AND VERY THICK.":GOTO9
1870 IFS$=O$(11)THENM$="HE'S BIG, AND SCARY.":GOTO9
1880 IFS$<>O$(35)THEN1910
1890 IFPA=1THEN7420
1900 M$="IT HAS A LOOSE PLANK, HELD ON WITH ONE NAIL.":GOTO9
1910 IFS$=O$(12)THENM$="IT'S AN OLD GRAVE, COVERED WITH WEEDS.":GOTO9
1920 IFS$=O$(34)THENM$="IT HAS A CLAWED HEAD.":GOTO9
1930 IFS$=O$(38)THENM$="IT LOOKS LIKE A TREASURE CHEST!":GOTO9
1940 IFS$=O$(13)THENM$="THEY LOOK LIKE THEY ARE HUMAN.":GOTO9
1950 IFS$=O$(14)THENM$="IT'S A RING, WITH A SMALL THIN SCREW COMING OFF IT.":GOTO9
1960 IFS$=O$(33)THENM$="IT'S A SENTRY POST!":GOTO9
1970 GOTO7420
1980 IFBA<>1THENM$="IT'S SHARP.":GOTO9
1990 IFBA=1THENM$="IT'S BLUNT.":GOTO9
2000 IFF$<>"FEED"THEN7310
2020 IFS$<>O$(2)THEN7580
2030 IFO(4)<>-1THEN7360
2040 IFR<>2THEN7360
2050 M$="THE GRUE HAS LIVED FOR OVER 100 YEARS AND ALONG THE WAY, HE HAS LEARNT HOW TO FEED HIMSELF!":GOTO9
2070 IFF$<>"GET"THEN2550
2090 IFEI>4THENM$="I'M CARRYING TOO MUCH!":GOTO9
2100 FORI=1TONO:IFS$=O$(I)THEN2110
2101 NEXT:GOTO7310
2110 IFO(I)<>-1THEN2120
2111 GOTO2140
2120 IFS$<>O$(26)THEN2170
2130 IFPR=1ORPA=0ANDR=7THENM$="HOW?":GOTO9
2140 IFPA=1ANDO(26)=RTHEN2540
2150 IFR<>7THEN7380
2160 IFO(26)=-1THEN7480
2170 IFS$=O$(52)THEN2180
2171 GOTO2200
2180 IFR=31ANDMC=1THEN7400
2190 M$="WHAT?":GOTO9
2200 IFO(I)<>RTHEN7380
2210 IFS$=O$(36)THENPRINT"IT'S HEAVY!":GOSUB8090:GOTO2540
2220 IFS$=O$(1)ORS$=O$(48)THEN2540
2240 IFS$=O$(51)THEN7190
2250 IFS$=O$(44)ANDGS=0THEN2540
2260 IFS$=O$(44)ANDGS=1THENM$="TOO HOT!":GOTO9
2270 IFS$=O$(43)THENPRINT"I FEEL POWER WITHIN IT.":GOSUB8090:GOTO2540
2280 IFS$=O$(8)THEN2540
2290 IFS$=O$(9)ANDMP<>1THENM$="MERCHANT WANTS SOMETHING.":GOTO9
2300 IFS$=O$(9)ANDMP=1THEN2540
2310 IFS$=O$(18)ORS$=O$(38)THENM$="IT'S TOO HEAVY!":GOTO9
2330 FORX=10TO11:IFS$=O$(X)THEN2540
2331 NEXT
2340 FORY=13TO15:IFS$=O$(Y)THEN2540
2341 NEXT
2350 IFS$=O$(18)ORS$=O$(12)THEN7400
2370 IFS$=O$(19)ORS$=O$(26)ORS$=O$(27)ORS$=O$(31)THEN2540
2410 IFS$=O$(7)ANDMS=0THENM$="HE AVOIDS YOU SAYING 'ARE YOU SOME KIND OF WEIRDO?'":GOTO9
2420 IFS$=O$(7)ANDMS=1THENM$="I DON'T WANT TO PICK UP A BODY WITH IT'S GUTS HANGING OUT!":GOTO9
2430 IFS$=O$(34)THEN2540
2440 IF(S$=O$(35)ANDUH=1)OR(S$=O$(37)ANDPS=1)THEN2540
2460 IFS$<>O$(22)THEN2490
2470 M$="NO THANKS!":GOTO9
2490 IFS$=O$(24)THENM$="IT'S STUCK!":GOTO9
2500 IFS$=O$(4)ANDAA=0THENM$="I CAN'T SEE ANY APPLE AROUND HERE!":GOTO9
2510 IFS$=O$(4)ANDAD<>1THENM$="I CAN'T REACH IT!":GOTO9
2520 IFS$=O$(4)ANDAD=1THENO(4)=-1:GOTO6
2530 GOTO7400
2540 O(I)=-1:EI=EI+1:GOTO6
2550 IFF$<>"GO"THEN2920
2570 IFS$<>O$(5)THEN2630
2580 IFR<>2THEN7360
2590 IFO(54)<>1THEN2790
2600 IFO(1)=-1THENM$="SOMETHING WON'T FIT!":GOTO9
2610 IFS$=O$(5)ANDR<>2THEN7360
2620 GOTO6240
2630 FORI=1TONO:IFS$=O$(I)THEN2640
2631 NEXT:GOTO7360
2640 IFS$="PLANK"THEN2750
2650 IFS$=O$(52)ANDR=31ANDMC=1THEN7290
2660 IFO(I)<>RTHEN7360
2670 IFS$=O$(6)ANDR=7THEN6390
2680 IFS$=O$(25)THEN6940
2690 IFS$=O$(17)THEN6880
2700 IFS$=O$(1)THEN830
2710 IFS$=O$(42)THEN6820
2720 IFS$=O$(29)THENM$="I'VE BEEN SWEPT UNDER BY THE CURRENT.":GOSUB1:GOTO7620
2730 IFS$=O$(23)THEN7000
2740 IFS$<>O$(26)THEN2830
2750 IFPR<>1THEN7600
2760 IFR=14THEN6600
2770 IFR=15THEN6570
2780 GOTO7600
2790 IFO(54)<>1THENM$="GRUE WON'T LET ME!":GOTO9
2800 GOTO6240
2810 IFAI<>1THEN7310
2820 GOTO7000
2830 IFS$<>O$(33)THEN2860
2840 IFR<>12THEN7360
2850 GOTO6480
2860 IFS$<>O$(30)THEN2890
2870 IFCC<>1THENM$="ONLY GHOSTS CAN WALK THROUGH DOORS!":GOTO9
2880 IFCC=1THEN6730
2890 IFS$<>O$(32)THEN7310
2900 IFPS=1ANDDO=1THEN7060
2901 GOTO7360
2920 IFF$<>"GIVE"THEN7310
2940 FORI=1TONO:IFS$=O$(I)THEN2960
2950 NEXT:GOTO7310
2960 IFS$<>O$(4)THEN3010
2970 IFR=13THEN3060
2980 IFR<>2THEN7360
2990 IFO(4)<>-1THEN7360
3000 M$="TO WHOM?":GOTO9
3010 IFS$<>O$(19)THEN3050
3020 IFR<>13ORO(19)<>-1THEN7360
3040 CM=1:GOTO3000
3050 IFS$<>O$(4)THEN7600
3060 IFO(4)<>-1THEN7360
3070 M$="TO WHOM?":ME=1:AM=1:GOTO9
3100 IFLEFT$(F$,3)<>"INV"THEN3200
3150 M$="I AM CARRYING:":GOSUB1:M$="":Y=0:FORI=1TONO
3170 IFO(I)=-1THENY=Y+1:M$=M$+O$(I)+", "
3180 NEXT:IFY=0THEN7340
3190 X=LEN(M$):M$=LEFT$(M$,X-2)+".":GOSUB1:GOTO540
3200 IFF$<>"INSERT"THEN7310
3210 FORI=1TONO:IFS$=O$(I)THEN3230
3220 NEXT:GOTO7310
3230 IFS$<>O$(14)THEN7580
3240 IFO(14)<>-1THEN7360
3250 IFR<>18THEN7360
3260 M$="IT FITS PERFECTLY IN THE HOLE.":GOSUB1:O(14)=0:AI=1:EI=EI-1:GOTO5
3300 IFF$<>"JUMP"THEN7310
3320 IFR<>29THEN3370
3330 IFO(56)=1THEN6330
3340 M$="I JUMP UP AND LUCKILY LAND BACK ON THE LADDER. JUMPING WHILST ON A LADDER IS NOT WISE!":O(56)=0:GOTO9
3370 IFR=16THENM$="I JUMP AND JUST MAKE IT TO THE OTHER SIDE.":GOSUB1:GOSUB8090:GOTO6660
3410 IFR<>17THEN3460
3420 IFO(36)=-1THENM$="THE WEIGHT OF THE STONE SHORTENS THE JUMP AND I FALL.":GOSUB1:GOTO7620
3430 M$="I JUMP ACROSS THE CHASM AND JUST MAKE IT TO THE OTHER SIDE.":GOSUB1:GOSUB8090:GOTO6630
3460 IFR=1THENM$="I JUMP AS FAR AS I CAN, BUT I END UP A FEW INCHES SHORT.":GOTO9
3480 IFR<>2THENM$="WHEE!":GOTO9
3490 M$="I HIT MY HEAD ON THE ROOF.":GOTO9
3510 IFF$<>"KILL"THEN7310
3530 IFS$=O$(7)ANDR=13ANDMS=0THEN3570
3540 IFS$=O$(46)ANDR=30ANDDD=0THEN3580
3550 IFS$=O$(2)ANDR=2ANDO(54)=0THEN3560
3551 GOTO7600
3560 IFS$<>O$(2)ANDR<>2THEN3570
3561 GOTO3590
3570 IFS$<>O$(7)ANDR<>13THEN3580
3571 GOTO3590
3580 IFS$<>O$(46)ANDR<>30THEN7580
3590 M$="HOW?":GOTO9
3610 IFF$="LOOK"THEN3630
3611 IFF$<>"LOAD"THEN7310
3613 LOAD*O,"ELGONDAT":R=O(53):BA=O(55):DD=O(57):CC=O(58):AD=O(59):EI=O(60):DF=O(61):SA=O(62):DS=O(63)
3614 AI=O(64):PR=O(65):PA=O(66):MP=O(67):UH=O(68):PS=O(69):EG=O(70):DO=O(71):YS=O(72):BO=O(73):BU=O(74)
3615 CR=O(75):WG=O(76):CM=O(77):AM=O(78):ME=O(79):SH=O(80):GS=O(81):MS=O(82):AA=O(83):MC=O(84):AD=O(85)
3630 GOSUB3950:GOTO540
3740 IFF$<>"MOVE"THEN7310
3760 FORI=1TONO:IFO$(I)=S$THEN3770
3761 NEXT:GOTO7310
3770 IFS$<>O$(38)THEN3810
3780 IFR<>31THEN7360
3790 IFMC=1THEN3800
3791 M$="AFTER MOVING THE CHEST, YOU DISCOVER A SMALL HOLE UNDER IT.":GOSUB1:O(52)=31:MC=1:GOTO5
3800 M$="OK, I MOVE IT BACK OVER THE HOLE.":GOSUB1:O(52)=0:MC=0:GOTO5
3810 IFS$=O$(36)THEN8
3820 FORI=1TONO:IFS$=O$(I)THEN7580
3821 NEXT:GOTO7310
3840 IFF$<>"N"THEN7310
3850 ONRGOTO6210,7,7,7,7,6360,7,7,7,7,7,7,6330,7,7,6600,7,7,7,6820,7,6910,7,6790,7,7,7,7,7,3930:GOTO7
3930 IFDD<>1THEN9050
3940 GOTO6300
3950 CLS:M$=R$(R):GOSUB1:GOSUB9020:GOSUB9010:GOSUB9000:RETURN
3970 IFF$<>"OPEN"THEN7310
3990 FORI=1TONO:IFS$=O$(I)THEN4010
4000 NEXT:GOTO7310
4010 IFS$<>O$(21)THEN4070
4020 IFBO=1THENM$="IT'S ALREADY OPEN!":GOTO9
4030 IFR<>11THEN7360
4040 IFBU<>1THENM$="IT'S LOCKED!":GOTO9
4050 O(16)=11:BO=1:GOTO6
4070 IFS$<>O$(32)THEN4120
4080 IFR<>5ORPS<>1THEN7360
4100 DO=1:GOTO8
4120 IFS$<>O$(38)THEN7580
4130 IFR<>31THEN7360
4140 M$="IT WON'T BUDGE!":GOTO9
4150 IFF$<>"PAY"THEN4220
4170 IFS$<>O$(7)THEN4250
4180 IFMP=1ANDO(19)=-1THENO(19)=0:EI=EI-1:GOTO8
4190 IFR<>13THEN7360
4200 IFO(19)<>-1THEN7360
4210 O(19)=0:MP=1:GOSUB5512:GOTO9
4220 IFF$<>"PUT"THEN4330
4230 FORI=1TONO:IFS$=O$(I)THEN4260
4240 NEXT:GOTO7310
4250 GOTO7580
4260 IFS$<>O$(26)THEN4320
4270 IFO(26)<>-1THEN7360
4280 IFR<>14THEN4320
4290 M$="THE PLANK IS PLACED OVER THE RIVER.":GOSUB1:GOSUB8090:O(41)=15:O(26)=R:PR=1:EI=EI-1
4320 O(I)=R:GOTO6
4330 IFF$<>"PULL"THEN4380
4340 IFS$<>O$(16)THEN4390
4350 M$="YOU HEAR A LOUD THUD, BUT NOTHING APPEARS TO HAPPEN.":O(42)=12:DB=1:GOTO9
4380 IFF$<>"PLACE"THEN7310
4390 GOTO4230
4400 IFF$<>"QUIT"THEN7310
4420 PRINT"ARE YOU SURE (Y/N)?"
4440 A$=INKEY$:IFA$="Y"THEN7630
4450 IFA$="N"THEN8
4451 GOTO4440
4470 IFF$<>"READ"THEN7310
4490 FORI=1TONO:IFS$=O$(I)THEN4510
4500 NEXT:GOTO7310
4510 IFS$<>O$(24)THEN4560
4520 IFWG<>1ORR<>1THEN7360
4540 M$="IF YOU'RE STUMPED, THE MAGIC WORD IS 5 LETTERS LONG AND ALPHABETICAL, EXCEPT THE FIRST ONE IS ALSO THE LAST."
4550 GOTO9
4560 IFS$<>O$(18)ORR<>21ORWG<>1THEN7360
4580 M$="THE BOOK HAS ONE WORD WRITTEN IN IT: 'RACK'":GOSUB1:O(17)=21:GOTO5
4600 IFF$<>"SAVE"THEN4690
4610 O(53)=R:O(55)=BA:O(57)=DD:O(58)=CC:O(59)=AD:O(60)=EI:O(61)=DF:O(62)=SA:O(63)=DS:O(64)=AI:O(65)=PR
4620 O(66)=PA:O(67)=MP:O(68)=UH:O(69)=PS:O(70)=EG:O(71)=DO:O(72)=YS:O(73)=BO:O(74)=BU:O(75)=CR:O(76)=WG
4640 O(77)=CM:O(78)=AM:O(79)=ME:O(80)=SH:O(81)=GS:O(82)=MS:O(83)=AA:O(84)=MC:O(85)=AD
4670 SAVE*O,"ELGONDAT":GOTO8
4690 IFF$<>"S"THEN4810
4700 ONRGOTO7,6180,7,7,7,6540,6330,6360,7,7,6510,7,7,7,6630,7,7,7,7,7,7,6760,7,7,6820,7,7,6700:GOTO7
4810 IFF$<>"SLAY"THEN4900
4820 IFS$<>O$(46)THEN4870
4830 IFR<>30THEN7360
4840 IFO(43)<>-1THEN7360
4850 IFDD=1THENM$="WHAT DRAGON?":GOTO9
4860 GOTO5690
4870 IFS$<>O$(7)THEN7610
4880 IFO(43)<>-1ORR<>13THEN7360
4890 MS=1:M$="YOU SLAY THE POOR MERCHANT.":GOTO9
4900 IFF$<>"SHOW"THEN4990
4910 FORI=1TONO:IFS$=O$(I)THEN4930
4920 NEXT:GOTO7310
4930 IFS$<>O$(10)THEN5460
4940 IFO(10)<>-1THEN7360
4950 IFR<>15THEN7440
4960 M$="THE GHOST LETS OUT A LOUD SHRIEK AND DISINTEGRATES.":GOSUB1:O(11)=0:SA=1:GOTO5
4990 IFF$<>"SAY"THEN5090
5000 IFS$<>"ACKRA"ORCR=1ORR<>18ORAI<>1THEN5080
5040 M$="A RAY OF LIGHT SHINES FROM THE SKY, REFLECTS THROUGH THE ANKH, AND OPENS A SMALL CRAWLWAY IN THE CLIFF.":GOSUB1
5050 O(23)=18:CR=1:GOTO5
5080 M$=S$:GOTO8
5090 IFF$<>"SHARPEN"THEN5150
5100 IFS$<>O$(8)THEN7580
5110 IFO(36)=-1ORO(36)=RTHENM$="IT'S SHARP AGAIN.":BA=0:GOTO9
5140 GOTO7360
5150 IFF$<>"SAW"THEN5210
5160 IFS$<>O$(37)THEN7580
5170 IFO(27)<>-1THEN7360
5180 IFR<>5THEN7360
5190 IFPS=1THENM$="I'VE ALREADY DONE THAT!":GOTO9
5200 M$="THE PADLOCK IS SAWN EASLIY AND FALLS OFF.":PS=1:GOTO9
5210 IFF$<>"SHAKE"THEN7310
5220 IFS$<>O$(3)THEN7580
5230 IFR<>6THEN7360
5240 M$="I SHAKE THE TREE AS HARD AS I CAN, BUT THE APPLE DOESN'T EVEN BUDGE.":GOTO9
5340 IFF$<>"TO"THEN7310
5360 IFAM=1THEN5380
5370 IFCM=1THEN5480
5371 GOTO5440
5380 IFME<>1THEN5430
5390 IFO(4)<>-1ORR<>13THEN7360
5410 IFMP=1THENO(4)=0:AM=0:ME=0:GOTO8
5420 IFMP<>1THENGOSUB5512:MP=1:O(4)=0:ME=0:AM=0:GOTO9
5430 FORI=1TONO:IFS$=O$(I)THEN5440
5431 NEXT:GOTO7580
5440 IFS$<>O$(2)THEN7310
5450 IFO(4)<>-1THEN7360
5460 IFR<>2THEN7360
5470 O(54)=1:O(4)=0:O(2)=0:M$="THE GRUE DISAPPEARS INTO THE WALL.":GOSUB1:GOTO5
5480 IFS$<>O$(7)THEN7580
5490 IFR<>13THEN7360
5500 IFMP=1THENO(19)=0:CM=0:GOTO8
5510 IFO(19)<>-1THEN7360
5511 GOSUB5512:MP=1:O(19)=0:CM=0:GOTO9
5512 EI=EI-1:M$="THE MERCHANT OFFERS YOU THE SHOVEL.":RETURN
5520 IFF$<>"U"THEN5580
5540 IFR=32THEN7140
5550 IFR<>26THEN7460
5560 GOTO6850
5580 IFF$<>"USE"THEN5760
5590 FORI=1TONO:IFS$=O$(I)THEN5610
5600 NEXT:GOTO7310
5610 IFS$<>O$(34)THEN5710
5620 IFO(34)<>-1THEN7360
5630 IFPA=1THEN7600
5640 IFR<>7THEN7440
5650 PA=1:O(26)=7:PRINT"OK":GOTO5
5690 M$="YOU SLAY THE DRAGON WITH MIGHTY FORCE.":GOSUB1:DD=1:O(46)=0:GOTO5
5710 IFS$<>O$(43)THEN5740
5720 IFR=13ANDMS=0THEN4890
5730 IFR=30ANDDD=0THEN5690
5740 M$="IT DOESN'T WORK.":GOTO9
5760 IFF$<>"UNLOCK"THEN5840
5770 FORI=1TONO:IFS$=O$(I)THEN5790
5780 NEXT:GOTO7310
5790 IFS$<>O$(21)THEN7580
5800 IFO(15)<>-1THEN7360
5810 IFR<>11THEN7360
5820 IFBU=1THENM$="IT'S ALREADY UNLOCKED!":GOTO9
5830 BU=1:GOTO8
5840 IFF$<>"UNWEAR"THEN7310
5850 IFS$<>O$(31)THENM$="IT WOULD BE HARD EVEN PUTTING THAT ON.":GOTO9
5860 IFO(31)<>-1ANDWG<>0THENM$="I'M NOT WEARING THEM.":GOTO9
5870 WG=0:GOTO8
5890 IFF$<>"W"THEN6060
5920 ONRGOTO7,7,6270,6300,7,7,7,6420,7,6390,7,6330,6570,7,7,7,6700,7,6760,7,6820,6510,6910,7,7,6970,7,7,7,7,7060:GOTO7
6060 IFF$<>"WEAR"THEN6130
6070 FORI=1TONO:IFS$=O$(I)THEN6090
6080 NEXT:GOTO7310
6090 IFS$<>O$(31)THEN7600
6100 IFO(31)<>-1THEN7360
6110 WG=1:GOTO8
6130 IFF$<>"WITH"THEN7310
6140 GOTO5590
6180 R=1:GOTO6
6210 R=2:GOTO6
6240 R=3:GOTO6
6270 R=4:GOTO6
6300 R=5:GOTO6
6330 R=6:GOTO6
6360 R=7:GOTO6
6390 R=8:GOTO6
6420 R=9:GOTO6
6450 R=10:GOTO6
6480 R=11:GOTO6
6510 R=12:GOTO6
6540 R=13:GOTO6
6570 R=14:GOTO6
6600 R=15:GOTO6
6630 R=16:GOTO6
6660 R=17:O(47)=17:GOTO6
6700 R=18:GOTO6
6730 R=19:GOTO6
6760 R=20:GOTO6
6790 R=21:GOTO6
6820 R=22:GOTO6
6850 R=23:GOTO6
6880 R=24:GOTO6
6910 R=25:GOTO6
6940 R=26:GOTO6
6970 R=27:GOTO6
7000 R=28:GOTO6
7030 R=29:GOTO6
7060 R=30:IFDD=1THEN3630
7090 GOSUB3950:IFO(44)<>-1THEN9040
7120 IFO(44)=-1THENM$="THE DRAGON BREATHS FIRE AT ME, BUT MY SHIELD DEFLECTS IT.":FB=0:GOTO9
7130 GOTO540
7140 R=31:O(38)=R:GOTO6
7190 PRINT:PRINT"YOU COMPLETED THE":GOSUB9060:GOTO7630
7250 SR=R:R=29:GOTO6
7290 R=32:O(51)=R:GOTO6
7310 M$="I DON'T UNDERSTAND!":GOTO9
7340 M$="I'M NOT CARRYING ANYTHING!":GOTO9
7360 M$="I CAN'T DO THAT...YET!":GOTO9
7380 M$="I CAN'T SEE IT HERE.":GOTO9
7400 M$="IT'S BEYOND MY POWER TO DO THAT.":GOTO9
7420 M$="I SEE NOTHING SPECIAL.":GOTO9
7440 M$="NOTHING HAPPENS.":GOTO9
7460 M$="I CAN'T GO THAT WAY!":GOTO9
7480 M$="I ALREADY HAVE THAT.":GOTO9
7500 M$="I FOUND NOTHING!":GOTO9
7520 M$="I FOUND SOMETHING!":GOSUB1:GOTO5
7580 M$="I CAN'T DO THAT.":GOTO9
7600 M$="SORRY.":GOTO9
7620 PRINT"I'M DEAD!"
7630 PRINT"PLAY AGAIN (Y/N)?"
7650 A$=INKEY$:IFA$="Y"THENRUN
7710 IFA$="N"THENEND
7720 GOTO7650
7780 DATA2,2,6,0,2,7,13,7,13,0,15,15,0,27,0,0,0,21,4,18,11,23,0,1,23,0,19,0,14,20,9,5,12,10,7,28,5,31,16,15,0,0,25,24,0
7781 DATA30,17,0,1,0,0,0
7790 DATA"LADDER","GRUE","TREE","APPLE","TUNNEL","SHACK","MERCHANT","AXE","SHOVEL","AMULET","GHOST","GRAVE","BONES","ANKH"
7791 DATA"KEY","LEVER","PASSAGE","BOOK","COIN","STUMP","BOX","SKELETON","CRAWLWAY","SIGN","STAIRS","PLANK","SAW","HOLE"
7800 DATA"RIVER","CLOSET","GLASSES","DOOR","POST","HAMMER","FENCE","STONE","PADLOCK","CHEST","CHASM","RIVER","PLANK"
7810 DATA"DRAWBRIDGE","SWORD","SHIELD","VAULT","DRAGON","CHASM","SPLINTERS","PIT","SPLINTERS","TREASURE","HOLE"
8090 PRINT"(HIT ANY KEY)"
8095 ON1-(INKEY$<>"")GOTO8095:RETURN
9000 FORX=1TO32:PRINT"-";:NEXT:RETURN
9010 PRINT"OBVIOUS EXITS ARE: ":FORX=1TOLEN(D$(R)):A$=MID$(D$(R),X,1):PRINTV$(VAL(A$));" ";:NEXT:PRINT:RETURN
9020 M$="VISIBLE ITEMS: ":FORI=1TONO:IFO(I)=RTHENM$=M$+O$(I)+", "
9030 NEXT:X=LEN(M$):M$=LEFT$(M$,X-2)+".":ON1-(LEN(M$)=14)GOTO9035:M$="NO "+M$
9035 GOSUB1:RETURN
9040 M$="I'VE BEEN BURNT BY A FIRE BREATHING DRAGON!":GOSUB1:GOTO7620
9050 M$="DRAGON WON'T LET ME!":GOTO9
9060 PRINT"treasure of elgon","럮뙊뜊뙇뙊뙇뜊뙊뙇":PRINT"꼨뀉뀉걞뀉뒒뀉꼪걞":PRINT"뇞깗땹깈뇞땹깈뇞깈BY K. HAWTHORN";:RETURN
9070 REM MC-EDITS BY JIM GERRIE
